package com.example.pharmacypick.service.impl;

import com.example.pharmacypick.mapper.AdministratorMapper;
import com.example.pharmacypick.pojo.Administrator;
import com.example.pharmacypick.service.AdministratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdministratorServiceImpl implements AdministratorService {


    @Autowired
    AdministratorMapper administratorMapper;

    @Override
    public Administrator administratorLogin(Administrator administrator) {
        Administrator administratorByUsername = administratorMapper.queryAdministratorByUsername(administrator.getUsername());

        if(administratorByUsername==null||!administratorByUsername.getPassword().equals(administrator.getPassword())){
            return null;
        }
        return administratorByUsername;

    }
}
